	<table>
		<thead>
			<tr>
				<th width="20"><?php echo form_checkbox(array('name' => 'action_to_all', 'class' => 'check-all')); ?></th>
				<th><?php echo lang('escort_thread_origin_label'); ?></th>
				<th class="collapse"><?php echo lang('escort_thread_sender_label'); ?></th>
				<th class="collapse"><?php echo lang('escort_thread_date_label'); ?></th>
				<th class="collapse"><?php echo lang('escort_thread_last_message_label'); ?></th>
				<th width="350"></th>
			</tr>
		</thead>
		<tfoot>
			<tr>
				<td colspan="6">
					<div class="inner"><?php $this->load->view('admin/partials/pagination'); ?></div>
				</td>
			</tr>
		</tfoot>
		<tbody>
			<?php foreach ($threads as $thread) : ?>
			
				<tr <?php echo $thread->status?'':'class="thread-unread"' ?> id="message_thread_<?php echo $thread->id?>">
					<td><?php echo form_checkbox('action_to[]', $thread->id); ?></td>
					<td><?php echo $thread->origin; ?></td>
					<td><?php echo $thread->owner; ?></td>
					<td class="collapse"><?php echo format_date($thread->created_time); ?></td>
					<td>
						<a href="admin/message/message/index/<?php echo $thread->id;?>">
						<?php echo substr($thread->message->message, 0 , 200) ?>
						</a>
					</td>
					<td>
						<?php
						if($thread->status){
						?>
						<?php echo anchor('#', lang('escort_thread_mark_as_unread_label'), 'class="btn orange edit mark-thread" id="'.$thread->id.'"'); ?>
						<?php
						}else{ 
						?>
						<?php echo anchor('#', lang('escort_thread_mark_as_read_label'), 'class="btn orange edit mark-thread" id="'.$thread->id.'"'); ?>
						<?php
						} 
						?>
						<?php echo anchor('admin/message/message/index/' . $thread->id, lang('escort_thread_answer_label'), 'class="btn orange edit"'); ?>
						<?php echo anchor('admin/message/delete/' . $thread->id, lang('global:delete'), array('class'=>'confirm btn red delete')); ?>
						<?php echo anchor('#escort-to', lang('escort_thread_escale_to_label'), 'name="'.$thread->solver_permission_slug.'" class="btn orange edit escort-to" id="'.$thread->id.'"'); ?>
					</td>
				</tr>
			<?php endforeach; ?>
		</tbody>
	</table>

	<div class="table_action_buttons">
		<?php $this->load->view('admin/partials/buttons', array('buttons' => array('delete', 'active'))); ?>
	</div>